package cn.getech.data.development.constant;

import lombok.Getter;

/**
 * 循环任务类型的枚举
 *
 * @author wcj
 */
@Getter
public enum ScheduleRepeatType {

    INTERVAL(2,"间隔"),
    REPEAT(1,"定时");

    Integer code;
    String name;

    ScheduleRepeatType(Integer code, String message) {
        this.code = code;
        this.name = message;
    }


    public static JobType ObjOf(Integer code) {
        if (code == null) {
            return null;
        } else {
            for (JobType s : JobType.values()) {
                if (s.getCode()== code) {
                    return s;
                }
            }
            return null;
        }
    }
}
